﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace VisionCloud.Core.Model.Sys
{
    [Table("SysDevice")]
    public class SysDevice : BaseEntity
    {
        [Key]
        public Guid DeviceGuid { get; set; }

        [Column(TypeName = "varchar(255)")]
        public string SysOrgId { get; set; }

        /// <summary>
        /// 设备软件版本号
        /// </summary>
        [Column(TypeName = "varchar(255)")]
        public string DeviceSoftwareVersion { get; set; }

        /// <summary>
        /// 产品序列号
        /// </summary>
        [Column(TypeName = "varchar(500)")]
        public string DeviceNumber { get; set; }

        /// <summary>
        /// 计算机编号
        /// </summary>
        [Column(TypeName = "varchar(500)")]
        public string ComputerNumber { get; set; }

        /// <summary>
        /// 计算机系统版本
        /// </summary>
        [Column(TypeName = "varchar(100)")]
        public string ComputerSystemVersion { get; set; }

        /// <summary>
        /// 计算机类型
        /// </summary>
        [Column(TypeName = "varchar(500)")]
        public string ComputerType { get; set; }

        /// <summary>
        /// 计算机出厂日期
        /// </summary>
        [Column(TypeName = "timestamp(0)")]
        public DateTime? ComputerDateOfProduction { get; set; }

        /// <summary>
        /// 扫描仪编号
        /// </summary>
        [Column(TypeName = "varchar(500)")]
        public string ScannerNumber { get; set; }

        /// <summary>
        /// 扫描仪类型
        /// </summary>
        [Column(TypeName = "varchar(50)")]
        public string ScannerType { get; set; }

        /// <summary>
        /// 扫描仪出厂日期
        /// </summary>
        [Column(TypeName = "date(0)")]
        public DateTime? ScannerDateOfProduction { get; set; }

        /// <summary>
        /// 扫描仪固件版本
        /// </summary>
        [Column(TypeName = "varchar(100)")]
        public string ScannerFirmwareVersion { get; set; }

        /// <summary>
        /// 是否激活
        /// </summary>
        public bool IsActive { get; set; }

        /// <summary>
        /// 激活日期
        /// </summary>
        [Column(TypeName = "timestamp(0)")]
        public DateTime? ActiveDate { get; set; }

        /// <summary>
        /// 激活人员
        /// </summary>
        public Guid? ActiveUserGuid { get; set; }

        /// <summary>
        /// 分配人员
        /// </summary>
        [Column(TypeName = "uuid")]
        public Guid? DeviceUserId { get; set; }

        /// <summary>
        /// 分配人员名称
        /// </summary>
        [Column(TypeName = "varchar(500)")]
        public string DeviceUserName { get; set; }

        /// <summary>
        /// 客户名称
        /// </summary>
        [Column(TypeName = "varchar(500)")]
        public string CustomerCompanyName { get; set; }

        /// <summary>
        /// 计算机保修期
        /// </summary>
        [Column(TypeName = "int(32)")]
        public int? ComputerExpire { get; set; }

        /// <summary>
        /// 扫描仪保修期
        /// </summary>
        [Column(TypeName = "int(32)")]
        public int? ScannerExpire { get; set; }

        /// <summary>
        /// 设备保修期
        /// </summary>
        [Column(TypeName = "int(32)")]
        public int? DeviceExpire { get; set; }

        /// <summary>
        /// 加密狗设备号
        /// </summary>
        //[Required]
        [Column(TypeName = "varchar(255)")]
        public string EncryptedDogNumber { get; set; }

        /// <summary>
        /// 加密狗类型
        /// </summary>
        //[Required]
        [Column(TypeName = "varchar(50)")]
        public string EncryptedDogType { get; set; }

        /// <summary>
        /// 设备出厂日期
        /// </summary>
        public DateTime? DeviceDateOfProduction { get; set; }

        /// <summary>
        /// 三脚架保修期
        /// </summary>
        public int? TripodExpire { get; set; }

        /// <summary>
        /// 客户联系方式
        /// </summary>
        public string CustomerPhoneNumber { get; set; }

        /// <summary>
        /// 三脚架类型
        /// </summary>
        public string TripodType { get; set; }

        [NotMapped]
        public int RowIndex { get; set; }

        [Column(TypeName = "varchar(100)")]
        public string DeviceNO { get; set; }

        /// <summary>
        /// 设备分配时间
        /// </summary>
        [Column(TypeName = "timestamp(0)")]
        public DateTime? AssignDate { get; set; }

        /// <summary>
        /// 设备唯一标识，mac地址
        /// </summary>
        public string DeviceMac { set; get; }
        public bool NeedUpdate { set; get; }

        public double Longitude { get; set; }
        public double Latitude { get; set; }
        /// <summary>
        /// 是否空闲 0:闲置、1:忙碌
        /// </summary>
        public int AvailableStatus { set; get; }
    }
}